<!doctype html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:yh="http://www.thymeleaf.org">
<head th:replace="themes/yqq/header::resources('个人博客日记','')"></head>

<link th:href="@{/yqq/page/css/pagination.css}" rel="stylesheet"/>
<script th:src="@{/yqq/page/js/underscore.js}" ></script>
<script th:src="@{/yqq/page/js/pagination.build.js}" ></script>

<body>
<!--top begin-->
<div th:replace="themes/yqq/header::top"></div>
<!--top end-->
<article> 
  <!--lbox begin-->
  <div class="lbox">
    <div class="whitebg lanmu"> <img th:src="@{/yqq/images/lm01.jpg}">
      <h1>个人博客日记</h1>
      <p th:if="${category==null and tag==null}">个人博客日记，按时间排序对我的文章进行展示。</p>
      <p th:if="${category!=null}">个人博客日记，按分类【<span th:text="${category}"></span>】对我的文章进行展示。</p>
      <p th:if="${tag!=null}">个人博客日记，按标签【<span th:text="${tag}"></span>】对我的文章进行展示。</p>
    </div>
    <div class="whitebg bloglist">
      <h2 class="htitle">最新博文</h2>
      <ul>
        <!--单图-->
        <li th:each="a:${articles.list}">
          <h3 class="blogtitle"><a th:href="@{'/article/'+${a.cid}}" target="_blank"><b th:if="${a.allowPing}">【顶】</b><span th:text="${a.title}"></span></a></h3>
          <span class="blogpic imgscale"><i><a href="javascript:return false;" th:text="${a.categories}">原创模板</a></i><a th:href="@{'/article/'+${a.cid}}" title=""><img th:src="@{${a.cover}}" alt=""></a></span>
          <p class="blogtext" th:text="${a.remark}">这些开源的博客程序源码，都是经过很多次版本测试的，都有固定的使用人群。我所知道的主流的博客程序有，Z-blog，Emlog，WordPress，Typecho等，免费的cms系统有，织梦cms（dedecms），phpcms，帝国cms（EmpireCMS）！... </p>
          <p class="bloginfo"><i class="avatar"><img th:src="@{/yqq/images/avatar.jpg}"></i><span th:text="${siteInfo.site_nickname}">张念祥</span><span th:text="${commons.fmtdate(a.created, 'yyyy-MM-dd')}">2018-10-28</span><span th:if="${a.tagList!=null}">【<d th:each="tag,stat:${a.tagList}"><a th:href="@{'/list?tag='+${commons.urlEncode(tag)}}" th:text="${tag}"></a><d th:text="${stat.count!=#lists.size(a.tagList)?',':''}"></d></d>】</span></p>
          
          <a th:if="${session.login_user!=null && session.login_user.username=='admin'}" target="_BLANK" th:href="@{'/admin/article/'+${a.cid}}" style="display: block;right: 100px;bottom: 20px;position: absolute;padding: 3px 10px;background: #12b7de;color: #fff;border-radius: 3px;">编辑</a>
          
          <a th:href="@{'/article/'+${a.cid}}" class="viewmore">阅读更多</a> </li>
        <li>
      </ul>
      
      <!--pagelist-->
<!--       <div class="pagelist"> -->
<!--       	<span title="总记录数"> -->
<!--       		&nbsp;共<b th:text="${articles.total}"></b> 条数据 -->
<!--       	</span>&nbsp;&nbsp;&nbsp; -->
      	
<!--       	<c th:if="${articles.total>0}"> -->
<!--       	<a th:href="'/list?page=1'+${categoryId==null?'':('&categoryId='+categoryId)}" th:if="${articles.isFirstPage==false}">首页</a>&nbsp; -->
<!--       	<a th:href="'/list?page='+${articles.prePage==0?1:articles.prePage}+${categoryId==null?'':('&categoryId='+categoryId)}" th:if="${articles.hasPreviousPage}">上一页</a>&nbsp; -->
<!--      		<c th:each="a,stat : ${#numbers.sequence( articles.pageNum-3<1?1:articles.pageNum-3  ,   articles.pageNum+3>articles.pages?articles.pages:articles.pageNum+3 )}"> -->
<!--      			<a th:if="${articles.pageNum!=stat.count}" th:href="'/list?page='+${stat.count}+${categoryId==null?'':('&categoryId='+categoryId)}"   th:text="${stat.count}">2</a> -->
<!--       			<b th:if="${articles.pageNum==stat.count}" th:text="${articles.pageNum}"></b> -->
<!--       			&nbsp; -->
<!--       		</c> -->
<!--       	<a th:href="'/list?page='+${articles.nextPage==0?1:articles.nextPage}+${categoryId==null?'':('&categoryId='+categoryId)}" th:if="${articles.hasNextPage}">下一页</a>&nbsp; -->
<!--       	<a th:href="'/list?page='+${articles.pages}+${categoryId==null?'':('&categoryId='+categoryId)}" th:if="${articles.isLastPage==false}">尾页</a> -->
<!--       	</c> -->
      
      </div>
      <!--pagelist end--> 
<!--     </div> -->
    <div class="pagination whitebg" style="width:100%"></div>
    <!--bloglist end--> 
  </div>
  <div class="rbox">
    
    <div class="whitebg paihang">
      <h2 class="htitle">点击排行</h2>
      <section class="topnews imgscale" th:if="${topRead1!=null}"><a th:href="@{'/article/'+${topRead1.cid}}"><img th:src="@{${topRead1.cover==null or topRead1.cover==''}?'/yqq/images/h1.jpg':${topRead1.cover}}"><span th:text="${topRead1.title}"></span></a></section>
      <ul>
        <li th:each="t:${topRead}"><i></i><a th:href="@{'/article/'+${t.cid}}" th:text="${t.title}"></a></li>
      </ul>
    </div>
    
    <div class="whitebg cloud">
      <h2 class="htitle">标签云</h2>
      <ul>
        <a th:href="@{'/list?tagId='+${t.mid}}" target="_blank" th:each="t:${allTags}" th:text="${t.name}+'('+${t.count}+')'">个人博客模板</a> 
      </ul>
    </div>
    
    <div class="whitebg wenzi">
      <h2 class="htitle">猜你喜欢</h2>
      <ul>
        <li th:each="r:${rand}"><a th:href="@{'/article/'+${r.cid}}" th:text="${r.title}">十条设计原则教你学会如何设计网页布局!</a></li>
      </ul>
    </div>

    <div class="whitebg tongji">
      <h2 class="htitle">站点信息</h2>
      <ul>
        <li><b>建站时间</b>：<span th:text="${options.site_time}"></span></li>
        <li><b>网站名称</b>：<span th:text="${options.site_title}"></span></li>
        <li><b>文章统计</b>：<span th:text="${articleSize}"></span>条</li>
        <li><b>文章评论</b>：<span th:text="${commentSize}"></span>条</li>
        <li><b>博主昵称</b>：<span th:text="${options.site_nickname}"></span></li>
        <li><b>博主微博</b>：<a th:href="@{${options.social_weibo}}" th:text="${options.social_weibo}"></a></li>
      </ul>
    </div>
    
  </div>
</article>
<div th:replace="themes/yqq/header::footer"></div>

<script th:inline="javascript">

$(function(){
	var lastLI = $(".bloglist ul li:last").html();
	lastLI = $.trim(lastLI);
	if(lastLI==null||lastLI==''){
		$(".bloglist ul li:last").remove();
	}
	
	var categoryId = [[${categoryId==null?'':categoryId}]];
	var category = [[${category==null?'':category}]];
	var tagId = [[${tagId==null?'':tagId}]];
	var tag = [[${tag==null?'':tag}]];
	new pagination({
		pagination:$('.pagination'),
		maxPage: 7, //最大页码数,支持奇数，左右对称
		startPage: 1,    //默认第一页
		currentPage: [[${articles.pageNum}]],          //当前页码
		 totalItemCount: [[${articles.total}]],    //项目总数,大于0，显示页码总数
		 totalPageCount: [[${articles.pages}]],        //总页数
		callback:function(pageNum){
			console.info("pageNum:"+pageNum);
			
			var url = ctxPath+"list?page="+pageNum;
			if(categoryId!=null && categoryId!=''){
				url += "&categoryId="+categoryId;
			}
			if(category!=null && category!=''){
				url += "&category="+category;
			}
			if(tagId!=null && tagId!=''){
				url += "&tagId="+tagId;
			}
			if(tag!=null && tag!=''){
				url += "&tag="+tag;
			}
			window.location.href=url;
		}
	});
});

</script>

<div th:replace="themes/yqq/header::trans"></div>
</body>
</html>
